package cfsmon.logic.nfm;

import org.apache.log4j.Logger;

public class NfmInputValidator {

	private static Logger logger = Logger.getLogger(NfmInputValidator.class);

	
	/**
	 * Adds for every empty default transition set a reflexive one.
	 */
	
	private static boolean hasAtLeastOneInitialState(INfm nfm){
		return !nfm.getInitialStates().isEmpty();
	}
	
	public static boolean isValid(INfm nfm) {
		
		if (nfm != null && hasAtLeastOneInitialState(nfm)){
			return true;
		} else {
			logger.error("The NFM has to have at least one initial state.");
			logger.error(nfm);
			return false;
		}
	}

}
